Skip to content

Locked outputs: render outputs of a lock group in one ffmpeg - #419

Merged
jsilvanus merged 3 commits into
mainfrom
claude/project-thread-laokje
Oct 26, 2026
Merged

jsilvanus merged 3 commits into
mainfrom
claude/project-thread-laokje

Conversation

@jsilvanus

Copy link
Copy Markdown
Owner

Requested by Juha · project thread

Before: every output with a DSK step ran its own ffmpeg, so two outputs from the same feed decoded and composited the picture twice and could drift apart.

After: outputs the user locks together are rendered by one ffmpeg. The composite is shared where the members' viewport lists start the same, and each member gets its own encode, written to its own MediaMTX path. Relay slots and the per-path fan-out read those paths as before, so a failing destination never restarts the group. Locking is manual only; crop and direct mode (tee straight to targets) are left out of v1.

How:

  • output-group-plan.js (buildGroupArgs, pure): trie of the members' viewport chains with split; buildDskStepArgs is its one-member case, so unlocked outputs are unchanged.
  • output_groups table and outputs.group_id (both Prisma schemas, SQLite, Postgres migration 0015), group rules in db/outputs.js: same input path, no crop, at most MAX_GROUP_MEMBERS (default 4), a group of one dissolves.
  • OutputStepManager runs a group as one process (one step against MAX_OUTPUT_STEPS); any graph change restarts the group once.
  • GET/POST /outputs/groups, DELETE /outputs/groups/:id, PATCH /outputs/:id { groupId }; "Render together with" on the Outputs card (fi/en/sv).
  • MEDIAMTX_RTMP_FLEET_BASE_URL: fleet steps published to the app host's 127.0.0.1.
  • Plan saved as docs/plans/plan_locked_outputs.md, with direct mode listed as possible future work.

Tests: new output-groups.test.js (golden args, a real ffmpeg run of the graphs, database rules, supervisor, routes), lcyt-rtmp suite 367 passing, lcyt-web unit and vitest suites passing, schema drift test passing. Never run against a real MediaMTX or fleet.


Generated by Claude Code

A lock group is made by hand from outputs that read the same input and have no crop. The step supervisor renders it as one process:
the composite is shared where the members' viewport lists start the same, and each member gets its own encode written to its own
MediaMTX path, so relay slots and the per-path fan-out are unchanged. Adds output_groups and outputs.group_id (both schemas,
Postgres migration 0015), /outputs/groups routes, a 'Render together with' choice on the Outputs card, MAX_GROUP_MEMBERS and
MEDIAMTX_RTMP_FLEET_BASE_URL (fleet steps published to the app host's 127.0.0.1). Plan: docs/plans/plan_locked_outputs.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019r6rBh5m7wxPwEpZ5vkaBK
@jsilvanus jsilvanus self-assigned this Oct 25, 2026
@github-actions

Copy link
Copy Markdown

Database Test Matrix ✅

Ran full test suite against both SQLite and PostgreSQL.

  • SQLite: ✅ PASS
  • PostgreSQL: ✅ PASS

See workflow results for details.

The hook calls setupToken(session) but never imported it, so main's
Vitest run failed with ReferenceError (2 tests in
useDskMetacodeSources.test.jsx). The import restores the call that
PR #418 added.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CT3RKPqtPUMvMaBZ6zHFbw
@github-actions

Copy link
Copy Markdown

Database Test Matrix ✅

Ran full test suite against both SQLite and PostgreSQL.

  • SQLite: ✅ PASS
  • PostgreSQL: ✅ PASS

See workflow results for details.

@jsilvanus
jsilvanus merged commit ae4b9bb into main Oct 26, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants